goog.provide('mitel.notification');

goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.string');
goog.require('goog.window');

(function() {
  var cancel = goog.dom.getElement('cancel');
  var open = goog.dom.getElement('open');

  goog.events.listen(cancel, goog.events.EventType.CLICK, function(event) {
    event.preventDefault();
    event.stopPropagation();

    window.close();
  });

  goog.events.listen(open, goog.events.EventType.CLICK, function(event) {
    event.preventDefault();
    event.stopPropagation();

    goog.window.popup('https://mail.google.com/mail/?#inbox/' + goog.string.remove(window.location.hash, '#'));
    window.close();
  });

})();
